<template>
  <div class="page_body">
    <HomeTop :topTitle="topTitle"></HomeTop>
    <div class="noInfoTips_body">
      <div class="noInfoTips_box">
        <div class="noInfoTips_box_title" v-if="sourceType == 1">
          暂无信息，请先完善信息
        </div>
        <div class="noInfoTips_box_title" v-if="sourceType != 1">
          暂无信息，请先进行注册
        </div>
        <div
          class="noInfoTips_box_btn"
          v-if="sourceType == 1"
          @click="toCoachRegisterFn()"
        >
          前往完善
        </div>
        <div
          class="noInfoTips_box_btn"
          v-if="sourceType != 1"
          @click="toRefereeRegisterFn()"
        >
          前往注册
        </div>
      </div>
    </div>
  </div>
</template>
<style src="../../assets/css/user/noInfoTips.css" scoped></style>

<script>
import HomeTop from "@/components/homeTop.vue";

export default {
  name: "NoInfoTips",
  components: {
    HomeTop,
  },
  data() {
    return {
      topTitle: "", // 顶部组件参数设置
      sourceType: 1, // 来源类型; 1. 教练员查看基本信息; 2. 裁判员查看基本信息; 3. 裁判员查看注册信息; 4. 裁判员查看会员信息
    };
  },
  created: function () {
    let query = this.$route.query;

    if (query.source != undefined && query.source != "") {
      this.sourceType = query.source;
    }

    if (this.sourceType == 1 || this.sourceType == 2) {
      this.topTitle = "基本信息";
    }
    if (this.sourceType == 3) {
      this.topTitle = "注册信息";
    }
    if (this.sourceType == 4) {
      this.topTitle = "会员信息";
    }
  },
  methods: {
    // 前往完善
    toCoachRegisterFn: function () {
      this.$router.replace({
        name: "CoachImprove",
      });
    },
    // 前往注册
    toRefereeRegisterFn: function () {
      this.$router.replace({
        name: "RefereeRegister",
      });
    },
  },
};
</script>
